package com.cf.log.core.domain;

import com.cf.code.core.CField;
import com.cf.code.core.CModel;
import com.cf.code.core.CPage;
import com.cf.crud.entity.BaseEntity;

import javax.persistence.*;
import java.util.Date;

/**
 * game-server-Log
 *
 * @author <a href="2428922347@qq.com">Zhu mingming</a>
 * @info
 * @since 2018/5/16 下午 01:34
 */
@Entity
@Table(name = "log")
@CModel(pages = {
        @CPage(title = "日志列表", path = "log", templateName = "list.ftl", outPutName = "list.ftl"),
        @CPage(title = "日志", path = "log", templateName = "add.ftl", outPutName = "add.ftl"),
        @CPage(title = "日志", path = "log", templateName = "update.ftl", outPutName = "update.ftl")
})
public class Log extends BaseEntity {

    //操作名字
    @Column(name = "name")
    @CField(lab = "操作名字")
    private String name;

    //方法名字
    @Column(name = "methodName")
    @CField(lab = "操作方法名字")
    private String methodName;

    //操作人
    @Column(name = "user")
    @CField(lab = "操作人")
    private String user;

    //操作参数
    @Column(name = "parameter")
    @CField(lab = "操作参数")
    private String parameter;


    @Column(name = "actionTime")
    @CField(lab = "操作时间")
    @Temporal(TemporalType.TIMESTAMP)
    private Date actionTime = new Date();

    //操作结果值
    @Column(name = "result")
    @CField(lab = "操作结果")
    private String result;

    @Column(name = "endTime")
    @CField(lab = "结束时间")
    @Temporal(TemporalType.TIMESTAMP)
    private Date endTime = new Date();

    @Column(name = "success")
    @CField(lab = "操作结果")
    private boolean success = false;

    public Date getEndTime() {
        return endTime;
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }

    public boolean isSuccess() {
        return success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }


    public String getUser() {
        return user;
    }

    public void setUser(String user) {
        this.user = user;
    }

    public String getParameter() {
        return parameter;
    }

    public void setParameter(String parameter) {
        this.parameter = parameter;
    }

    public Date getActionTime() {
        return actionTime;
    }

    public void setActionTime(Date actionTime) {
        this.actionTime = actionTime;
    }

    public String getResult() {
        return result;
    }

    public void setResult(String result) {
        this.result = result;
    }

    public String getMethodName() {
        return methodName;
    }

    public void setMethodName(String methodName) {
        this.methodName = methodName;
    }
}
